Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,6 @@ htmlcov/
.idea
.vscode

# cProfile output
# profile outputs
*.prof
pytest_profile_stats.txt
4 changes: 3 additions & 1 deletion docs/development/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ There are a range of handy development functions that you might want to use to s
* - Running ``pytest`` commands inside the ``poetry`` environment.
- Make sure you have already installed ``tidy3d`` in ``poetry`` and you are in the root directory.
- ``poetry run pytest``
* - Analyze slow ``pytest`` runs with durations / cProfile / debug subset helpers.
- Use ``--debug`` to run only the first N collected tests or ``--profile`` to capture call stacks.
- ``python scripts/profile_pytest.py [options]``
* - Run ``coverage`` testing from the ``poetry`` environment.
-
- ``poetry run coverage run -m pytest``
Expand All @@ -84,4 +87,3 @@ There are a range of handy development functions that you might want to use to s
- ``poetry run tidy3d develop replace-in-files``



43 changes: 19 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pytest-timeout = { version = "*", optional = true }
pytest-xdist = "^3.6.1"
pytest-cov = "^6.0.0"
pytest-env = "^1.1.5"
pytest-order = { version = "^1.2.1", optional = true }
tox = { version = "*", optional = true }
diff-cover = { version = "*", optional = true }
zizmor = { version = "*", optional = true }
Expand Down Expand Up @@ -154,6 +155,7 @@ dev = [
'pytest-xdist',
'pytest-env',
'pytest-cov',
'pytest-order',
'rtree',
'ruff',
'sax',
Expand Down Expand Up @@ -312,9 +314,11 @@ banned-module-level-imports = ["scipy", "matplotlib"]

[tool.pytest.ini_options]
# TODO: remove --assert=plain when https://github.com/scipy/scipy/issues/22236 is resolved
addopts = "--cov=tidy3d --doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical'"
addopts = "--cov=tidy3d --doctest-modules -n auto --dist worksteal --assert=plain -m 'not numerical and not perf'"
markers = [
"numerical: marks numerical tests for adjoint gradients that require running simulations (deselect with '-m \"not numerical\"')",
"perf: marks tests which test the runtime of operations (deselect with '-m \"not perf\"')",
"slow: marks tests as slow (deselect with -m 'not slow')",
]
env = ["MPLBACKEND=Agg", "OMP_NUM_THREADS=1", "TIDY3D_MICROWAVE__SUPPRESS_RF_LICENSE_WARNING=true"]
doctest_optionflags = "NORMALIZE_WHITESPACE ELLIPSIS"
Expand Down
Loading