Skip to content

Commit

Permalink
Add cleanup call to all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MinyazevR authored and iakov committed Dec 12, 2024
1 parent 0078875 commit 79653a8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/PythonQtTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,28 @@ void PythonQtMemoryTests::cleanup()
void PythonQtMemoryTests::testBaseCleanup()
{
PythonQt::init();
cleanup();
}

void PythonQtMemoryTests::testCleanupWithFlags()
{
PythonQt::init(PythonQt::IgnoreSiteModule | PythonQt::RedirectStdOut);
cleanup();
}

void PythonQtMemoryTests::testInitAlreadyInitialized()
{
Py_InitializeEx(true);
PythonQt::init(PythonQt::PythonAlreadyInitialized);
cleanup();
}

void PythonQtMemoryTests::testSeveralCleanup() {
return;
PythonQt::init();
PythonQt::preCleanup();
PythonQt::cleanup();
cleanup();

PythonQt::init();
cleanup();
}

void PythonQtMemoryTests::testInitWithPreconfig() {
Expand All @@ -85,6 +87,7 @@ void PythonQtMemoryTests::testInitWithPreconfig() {
PyConfig_InitPythonConfig(&config);
Py_InitializeFromConfig(&config);
PythonQt::init(PythonQt::RedirectStdOut | PythonQt::PythonAlreadyInitialized);
cleanup();
#endif
}

Expand Down

0 comments on commit 79653a8

Please sign in to comment.