Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make tests extensible from corporate site #4095
Most of the changes look good so far. I'm not 100% certain on the use of a tag like
only_community to skip these. I think something more explicit or descriptive is better.
For instance, perhaps tests should mark xfail on a condition:
@pytest.mark.xfail(not pytest.config.getvalue("community"), reason="Overridden logic on the queryset can cause this to fail") def test_case_something_something(...): pass
Again, this is all a little weird as we should not be referencing commercial code in any of this. That would be really confusing for contributors, as they will never be able to see this code.
Alternatively, inside the test was can xfail with even more specificity.
A few of the patterns used in this PR can be replaced with more pytest internals -- such as replacing any mention of
readthedocsinc and such with a pytest config option.
At this point, I don't want to make the whole suite to be executed in both repositories and pass. I think that marking all community test as xfail does not add value since they are not thought to fail for any specific reason. I'd say that we can think a better way for those tests and later and improve what we have.
I had to modify a couple of tests to be compatible with both repositories and I found some patterns that we will need to follow when writing new tests in the community site:
I like this pattern, besides overriding
PYTEST_OPTIONS, which we'll find a better way to do later, this is all really clean on both sets of code.