pytest-dev / pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
https://pytest.org
MIT License
12.07k stars 2.67k forks source link

py.test 2.6.4: selected test passes, but fails in whole test file #629

Closed pytestbot closed 9 years ago

pytestbot commented 9 years ago

Originally reported by: Olga Botvinnik (BitBucket: olgabot, GitHub: olgabot)


Hello, I'm using py.test in a bioinformatics software package called flotilla. https://github.com/YeoLab/flotilla

In the branch "py.test_bug", if I run py.test flotilla/test/data_model/test_study.py, the test test_save failes. But, if I run py.test -k test_save flotilla/test/data_model/test_study.py, the test passes. Here's the output: https://gist.github.com/olgabot/4a66e5144852ee7c306e

Originally was using pytest 1.7.0, but I still get this inconsistency with 2.6.4.


pytestbot commented 9 years ago

Original comment by Olga Botvinnik (BitBucket: olgabot, GitHub: olgabot):


Turns out I was modifying the fixture within the tests. Using copy.deepcopy() solved it.