Commit graph

19 commits

Author SHA1 Message Date
Sagar Vora
b3e1eda4c8
feat: global frappe.in_test flag (#32960)
* feat: global `frappe.in_test` flag

* feat: helper utility to toggle `frappe.in_test`

* fix: use `toggle_test_mode` util

* fix: use `frappe.in_test`

* chore: add comment explaining global `in_test`

* chore: ignore commit replacing flag usage

* test: temporarily disable `frappe.in_test`

this worked earlier because flag was set in werkzeug.local which was separate for API test client

* test: add comment explaining change
2025-06-17 19:19:31 +05:30
ruthra kumar
0c6c6f50c4 refactor: support failfast and minor changes 2025-06-05 09:23:03 +05:30
ruthra kumar
4640a78587 refactor: move loader to new fiel
- barebones TestResult class
 - removed debugging statements
2025-06-05 09:23:03 +05:30
ruthra kumar
7e6b8fbf1c refactor: better code readibility 2025-06-05 09:23:03 +05:30
Akhil Narang
c3bcfdead5
chore: set default max_module_depth to 0
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-12-04 17:19:02 +05:30
Akhil Narang
722c72a5bf
refactor: tomllib -> tomli
Need to maintain python3.10 compatibility

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
2024-11-29 11:32:07 +05:30
David Arnold
e2a8c7fed3
test: fix universal type checker based on downstream use and more testing (#28619)
* test: fix universal type checker based on downstream use and more testing

* fix: type validation error reporting

* fix: types; various

* chore: switch off test-time type checking

still too many errors
2024-11-28 23:35:32 +01:00
David Arnold
9edd44de01
ci: this adds universal runtime typechecking during tests to test runners (#28554)
* ci: this adds universal runtime typechecking during tests to test runners

* ci: add configuration options for test-time type checking
2024-11-28 15:11:30 +00:00
David Arnold
786106d45e
fix: full compat mode for FrappeTestCase on run-tests cmd (#28457) 2024-11-13 17:54:14 +01:00
David Arnold
aa41cbad76
fix(testing): tolerate missing app.tests module (#28456) 2024-11-13 16:19:39 +00:00
David Arnold
9095c6f6d1
fix: finer grained test categorization of legacy frappe test case (#28387) 2024-11-13 11:30:09 +01:00
David Arnold
4000cba810
fix: compat FrappeTestCase (#28367)
due to circular imports issues and me going out of my way to make it work 'cleanly', the previous backwards compatibility for FrappeTestCase unfortunately did not work on the manual cli test runner 'run-tests'

While not generally not affecting CI (which is precedented by the framwork's best practices to use 'run-parallel-test'), this broke some manual developer workflows

The restauration of FrappeTestCase in these scenario now unfortunately involves a plain copy of almost an entire implementation into the dumpster.

On the one hand, this doesn not accurately reflect the rather minuscule differences between IntegrationTestCase and FrappeTestCase, but on the other hand, it shields and freezes the old api should IntegrationTestCase evolve futher
2024-11-05 18:16:22 +01:00
David Arnold
2f9fd308e8
fix(testing): pdb post mortem (#28156) 2024-10-17 18:52:25 +00:00
David Arnold
3e3ebd2593
style: test class & module output capture (#28096) 2024-10-11 23:24:01 +00:00
David Arnold
db93823001
feat: better test & dumpster output (#28044) 2024-10-09 12:05:19 +02:00
David Arnold
95950c8d81
refactor: organize test contextmanagers (#28041)
* refactor: prefer staticmethod decorator

* refactor: add cm register utility and keep cms in one file

* refactor: enter safe_exec enabled context (treewide)

* refactor: move trace fields to the other test context managers

* chore: marke all test_runner functions for deprecation

* chore: mark some tests.utils functions for deprecation (moved)

* chore: mark traced_field_conext for deprecation (moved)

* chore: placate semgrep in dumpster

* fix: show deprecation warnings per module in tests (incl. from dumpster)

* chore: remove use of deprecated functions from tests
2024-10-09 02:09:19 +02:00
David Arnold
e7776021aa
refactor: Structure frappe.test.utils (green to green) (#28038)
* docs: constitute frappe.test readme

* refactor: move utils to __init__

* refactor: move generators into generators.py

* refactor: move cm into context_managers.py

* refactor: move test classes into submodule

* refactor: reexport general purpose context managers

* refactor: adapt imports (treewide)
2024-10-08 15:10:24 +00:00
David Arnold
5324431fc0
fix: Testing Module 28000 (#28032)
* fix: logging text

* fix: app handling
2024-10-08 10:14:19 +00:00
David Arnold
7e453ea515
Testing Module (#28000)
* refactor: add create_handler alongside create_logger

* fix: bench helper click exceptions for --help (2nd attempt)

* fix: increase logging level missing test records

* fix: reorganize test runner into testing module and refine logging

* fix: semgrep complaint

* chore: remove unused code; only keep deprecation proxies

* fix: import statements

* fix: output & string processing
2024-10-07 09:46:49 +02:00