Skip to content

Use context manager in tests instead of modifying the global configurations #115

@Schefflera-Arboricola

Description

@Schefflera-Arboricola

How does one use the pytest.mark.order? Set it to 2 for tests that set config settings? And leave it off otherwise? Why use mark.order rather than resetting the values after the test finishes? Is it that a failed test will not reset the config? Can we use a context manager to reset the config settings?

I agree that using a context manager would make more sense for running tests because then the tests would be more independent of each other-- like you mentioned the case when the first test fails then the configs may or may not be what the second test would expect.

Originally posted by @Schefflera-Arboricola in #113 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions