Skip to content

Conversation

Lunderberg
Copy link
Contributor

In these cases, the test function should be marked as failing the setup, and should not run. This is pytest's default behavior, and should work whether or not a fixture is cached.

@Lunderberg
Copy link
Contributor Author

@areusch

def test_uses_broken_cached_fixture(self, broken_cached_fixture):
type(self).num_uses_broken_cached_fixture += 1

def test_num_uses_cached(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we parallelize testing, will this inter-test dependency work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it will not. We'd need to also add a call to pytest_xdist_make_scheduler (example stack overflow post) in order to force these tests to be run in order on a single node.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in our conversation yesterday, I've added a comment regarding pytest-xdist and the link to the above stackoverflow post to this PR, so that it will be easier to find if/when we parallelize the testing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems like a reasonably easy thing to do. thanks @Lunderberg !

…e of a broken fixture.

In these cases, the test function should be marked as failing the
setup, and should not run.  This is pytest's default behavior, and
should work whether or not a fixture is cached.
@Lunderberg Lunderberg force-pushed the tvm_testing_broken_fixture branch from b0b0551 to 770ebc1 Compare June 29, 2021 17:46
@masahi masahi merged commit 9ed593e into apache:main Jun 30, 2021
@Lunderberg Lunderberg deleted the tvm_testing_broken_fixture branch June 30, 2021 13:30
ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
…e of a broken fixture. (apache#8343)

In these cases, the test function should be marked as failing the
setup, and should not run.  This is pytest's default behavior, and
should work whether or not a fixture is cached.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
zxy844288792 pushed a commit to zxy844288792/tvm that referenced this pull request Mar 4, 2022
…e of a broken fixture. (apache#8343)

In these cases, the test function should be marked as failing the
setup, and should not run.  This is pytest's default behavior, and
should work whether or not a fixture is cached.

Co-authored-by: Eric Lunderberg <elunderberg@octoml.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants