Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patched test case class breaks pytest #747

Closed
donkirkby opened this issue Nov 8, 2018 · 2 comments
Closed

Patched test case class breaks pytest #747

donkirkby opened this issue Nov 8, 2018 · 2 comments

Comments

@donkirkby
Copy link
Member

I tried switching to running the tests with pytest, because it gives more details about failures, but I ran into a problem with integrity errors and foreign key constraints.

To see the error, try this command:

pytest --ds kive.settings_test_pg \
archive/tests.py::StateMachineActualExecutionTests::test_long_output \
archive/tests.py::TopLevelRunTests::test_usual_run

The problem seems to be caused by our patched version of TransactionTestCase: SlurmExecutionTestCase. If I replace that with a basic TestCase, then the error goes away.

We could ignore this problem by sticking with unittest, but I'd prefer to run with pytest.

@donkirkby
Copy link
Member Author

Try switching again after #752 is done, because that will probably remove the slurmlib package.

@donkirkby donkirkby added this to the Near future milestone Jan 15, 2019
@wrpscott
Copy link
Contributor

[root@kive kive]# sudo -u wscott -E bash -c "pytest --ds kive.settings_test_pg"
============================================= test session starts =============================================
platform linux2 -- Python 2.7.5, pytest-4.6.6, py-1.8.0, pluggy-0.13.0
Django settings: kive.settings_test_pg (from command line option)
rootdir: /kivesrc/kive, inifile: pytest.ini
plugins: django-3.7.0

pytest now works perfectly. Only tested under python2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants