potiuk commented on a change in pull request #4938: [AIRFLOW-4117]
Multi-staging Image - Travis CI tests [Step 3/3]
URL: https://github.com/apache/airflow/pull/4938#discussion_r299767310
##########
File path: setup.py
##########
@@ -47,26 +47,10 @@
long_description = ''
-class Tox(TestCommand):
- user_options = [('tox-args=', None, "Arguments to pass to tox")]
-
- def __init__(self, dist, **kw):
- super().__init__(dist, **kw)
- self.test_suite = True
- self.test_args = []
- self.tox_args = ''
-
- def initialize_options(self):
- TestCommand.initialize_options(self)
-
- def finalize_options(self):
- TestCommand.finalize_options(self)
-
- def run_tests(self):
- # import here, cause outside the eggs aren't loaded
- import tox
- errno = tox.cmdline(args=self.tox_args.split())
- sys.exit(errno)
+def airflow_test_suite():
+ test_loader = unittest.TestLoader()
+ test_suite = test_loader.discover('tests', pattern='test_*.py')
Review comment:
I just tested it. When I remove it I got the error below when try to run
python setup.py test.
When I leave the test_suite as it is - it actually starts running the tests.
I think it's not worth to investigate at this stage and I think we can leave
it as its unless we have better idea how to change it. Resolving the
conversation then.
```
Traceback (most recent call last):
File "setup.py", line 442, in <module>
do_setup()
File "setup.py", line 437, in do_setup
python_requires='~=3.5',
File
"/Users/potiuk/.virtualenvs/airflow-3.6/lib/python3.6/site-packages/setuptools/__init__.py",
line 145, in setup
return distutils.core.setup(**attrs)
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/core.py",
line 148, in setup
dist.run_commands()
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py",
line 955, in run_commands
self.run_command(cmd)
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py",
line 974, in run_command
cmd_obj.run()
File
"/Users/potiuk/.virtualenvs/airflow-3.6/lib/python3.6/site-packages/setuptools/command/test.py",
line 229, in run
self.run_tests()
File
"/Users/potiuk/.virtualenvs/airflow-3.6/lib/python3.6/site-packages/setuptools/command/test.py",
line 251, in run_tests
exit=False,
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py",
line 94, in __init__
self.parseArgs(argv)
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py",
line 118, in parseArgs
self._do_discovery(argv[2:])
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/main.py",
line 229, in _do_discovery
self.test = loader.discover(self.start, self.pattern, self.top)
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py",
line 341, in discover
tests = list(self._find_tests(start_dir, pattern))
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py",
line 398, in _find_tests
full_path, pattern, namespace)
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py",
line 475, in _find_test_path
tests = self.loadTestsFromModule(package, pattern=pattern)
File
"/Users/potiuk/.virtualenvs/airflow-3.6/lib/python3.6/site-packages/setuptools/command/test.py",
line 55, in loadTestsFromModule
tests.append(self.loadTestsFromName(submodule))
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py",
line 190, in loadTestsFromName
return self.loadTestsFromModule(obj)
File
"/Users/potiuk/.virtualenvs/airflow-3.6/lib/python3.6/site-packages/setuptools/command/test.py",
line 55, in loadTestsFromModule
tests.append(self.loadTestsFromName(submodule))
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/loader.py",
line 153, in loadTestsFromName
module = __import__(module_name)
File
"/Users/potiuk/code/airflow-breeze-gcp-extension/workspaces/polidea/airflow/airflow/migrations/env.py",
line 28, in <module>
config = context.config
AttributeError: module 'alembic.context' has no attribute 'config'
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services