You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Good Integration Practices guide includes an example of how to integrate with setuptools. It doesn't work anymore since test_args is now read-only. The problem was also discovered by users of the Marshmallow library, however their fix was to not use setuptools anymore.
importsysfromsetuptools.command.testimporttestasTestCommandclassPyTest(TestCommand):
user_options= [('pytest-args=', 'a', "Arguments to pass to py.test")]
definitialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args= []
deffinalize_options(self):
TestCommand.finalize_options(self)
self.test_args= []
self.test_suite=Truedefrun_tests(self):
#import here, cause outside the eggs aren't loadedimportpytesterrno=pytest.main(self.pytest_args)
sys.exit(errno)
setup(
#...,tests_require=['pytest'],
cmdclass= {'test': PyTest},
)
Traceback (most recent call last):
File "setup.py", line 72, in <module>
cmdclass={'test': TestCommand, 'build_ext': BuildExtCommand},
File "/usr/lib/python3.5/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.5/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.5/distutils/dist.py", line 973, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python3.5/distutils/cmd.py", line 107, in ensure_finalized
self.finalize_options()
File "setup.py", line 15, in finalize_options
self.test_args = []
AttributeError: can't set attribute
The text was updated successfully, but these errors were encountered:
The Good Integration Practices guide includes an example of how to integrate with setuptools. It doesn't work anymore since
test_args
is now read-only. The problem was also discovered by users of the Marshmallow library, however their fix was to not use setuptools anymore.The text was updated successfully, but these errors were encountered: