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

detect if running examples from pytest in the recommended way #292

Closed
jshipton opened this issue Aug 23, 2022 · 2 comments
Closed

detect if running examples from pytest in the recommended way #292

jshipton opened this issue Aug 23, 2022 · 2 comments
Assignees
Labels
tidying Pull requests or issues that involve tidying up code

Comments

@jshipton
Copy link
Contributor

See here:
https://doc.pytest.org/en/latest/example/simple.html#detect-if-running-from-within-a-pytest-run

@jshipton jshipton added the tidying Pull requests or issues that involve tidying up code label Aug 23, 2022
@JDBetteridge
Copy link
Member

Is the idea that this would replace the

if '--running-tests' in sys.argv:
    nlayers = 5
    columns = 30
    tmax = dt
    dumpfreq = 1
else:
    nlayers = 10
    columns = 150
    tmax = 3600.
    dumpfreq = int(tmax / (2*dt))

pattern in the examples?

@jshipton
Copy link
Contributor Author

Resolved by #541

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tidying Pull requests or issues that involve tidying up code
Projects
None yet
Development

No branches or pull requests

2 participants