Call to global_init() required to run any test individually
See original GitHub issueEach specific rest requires global_init() to be ran before it can be run. The test_can_call_init_with_good_path()
test does this, and that appears to enable all other tests to run.
def test_can_call_init_with_good_path():
fc.global_init(folder, cache_init=False)
If you run various tests individually, they error out because global_init is not called. I am working on a fix for the fastapi-jinja library that uses a pytest fixture to make this work. I am basically creating a fixture that is like this:
@pytest.fixture
def call_global_init():
here = os.path.dirname(__file__)
folder = os.path.join(here, "templates")
fc.global_init(folder, cache_init=False)
The fixture could then be added to any test that requires global init to be called. It should work, but I want to verify.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Imagining a thread-safe curl_global_init - Daniel Stenberg
There's a counter counting calls to curl_global_init() so that the corresponding number of calls to curl_global_cleanup() is required before ...
Read more >lab04 - Odds and primes: Fun with arrays and makefiles -
This lab must be completed individually (and not with a pair partner). ... Then use an ls command, and you should see new...
Read more >Global test initialize method for MSTest - Stack Overflow
Create a public static method, decorated with the AssemblyInitialize attribute. The test framework will call this Setup method once per test run:
Read more >Initialize global data separately and run_once in WSGI app init ...
We have discovered that if an exception is raised at any point during the running of the init_application WSGI script in an apache/mod_wsgi...
Read more >dejagnu.pdf - GNU.org
the GNU Free Documentation License, Version 1.3 or any later version ... Running tests requires two things: the testing framework and the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@fferegrino Yes, that’d be great! I’ll definitely take a PR on it if you’re game.
This is fixed with @fferegrino’s latest PR I just merged. Thank you both.