From 4e465e279d954043865c81a2f216ae1d2320ec68 Mon Sep 17 00:00:00 2001 From: TimTheHero <117226730+TimTheHero@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:00:29 +0100 Subject: [PATCH 1/3] feat: add run_tests - create a skript that used coverage to create folder with html coverage analysis --- tests/.coverage | Bin 0 -> 53248 bytes tests/run_tests.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 tests/.coverage create mode 100644 tests/run_tests.py diff --git a/tests/.coverage b/tests/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..d7c025c6bebda70bfe3d0dc14212b636ae98c860 GIT binary patch literal 53248 zcmeI4Yit}>6@c$N_Pw){;G`=nZ9OPTY^#36g0^Z=;~2+rLYp`)PLaTLGrK#s2X=Ry znc2h^O?Ee_6oG_VA%UQT(}C}W&imv*0y6MG0!RP} zAc6mH0)^qQFWTJ9oIYvF@swifazfFav(W$iK;OuKG}8Cw=LRGvO==5DaCCM`eUh%7 zkR}yf8dFn>q-K(8LN?XRxMWT!Zt1L{Bb6;@Evxp{HK&W5wy0Apn^BKtmDR@Y zkg7F1Y%?-iheVA457-g%MxSb82zaG3WgJVv=dGBWH8uM>28|!J?}bDGuU4P1xjZ|pa;m()86?M11Sq>b5KhSrvx#sP1x?K9mj3|Xfg zP0}g_LDT!{ZB$v%L5ioec)hRL9%CrbL0~L!i;ZP73EEW*YC}RhuITc((pAZIhK2j> zNZ>j>0dI7mWh2*Fb%9vVYBX4A_WGjRwlSvzwi{Jis}lI?T*z(7b%s$lE3L>zR(A)I zPZ}iM8r4zK?IV>OFsIY!jrMKZ$ec>KSWhM5FZg(0bn8~8;PePOF44EA&Ip=P?E-5i zf={phq-;(|cj``)LGf0PH~OWm8!1jzi1pC3_slm~TjjIOHvKdV`t;4!sZ3Lg{ICBHkIAFj%RYS6MxN}zOt;#T_sf_XCt+r0? zt6SSMsdO6Uq?!d%+k%6*a>(AJ9e z&@){n`{_ryLJQ-IKK2+>$W}U|GtR^enAFpH4;D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>H zZ&{@|xU@p{^Z(*6h`1zvEM67=DHg>K#rMTOiGL6;if@Z=Ko%ZI00|%gB!C2v01`j~ zNB{{S0VIF~kifkmK)>8z1i=o%VLJ$g>>wDlgFwIz{C+#|`Ru^!wF8gG4tU-UIL;1O zmWMA4?BD;%rh8)q-USID0VIF~kN^@u0!RP}AOR$R1dsp{xIYBw@Bg^|zd!8pu1Ek0 zAOR$R1dsp{Kmter2_OL^fCTOp0s8zuuK({9ZM+W>Kmter2_OL^fCP{L5 Date: Fri, 6 Dec 2024 17:18:57 +0100 Subject: [PATCH 2/3] Update run_tests.py --- tests/run_tests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/run_tests.py b/tests/run_tests.py index fc5ca74..9a6243b 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -2,6 +2,13 @@ import subprocess def run_tests(): + + try: + import coverage + except ImportError: + print("Coverage is not installed. Please install it using 'pip install coverage'.") + exit("coverage is not installed") + # Set dir to test dir: test_directory = os.path.dirname(os.path.abspath(__file__)) # Run tests with coverage From 46c53fef0fd72df69e2aef2e21d4dfdc0e418ac5 Mon Sep 17 00:00:00 2001 From: TimTheHero <117226730+TimTheHero@users.noreply.github.com> Date: Fri, 6 Dec 2024 17:21:26 +0100 Subject: [PATCH 3/3] Update run_tests.py --- tests/run_tests.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/run_tests.py b/tests/run_tests.py index 9a6243b..7ba885c 100644 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -1,22 +1,24 @@ import os.path import subprocess + def run_tests(): try: import coverage except ImportError: - print("Coverage is not installed. Please install it using 'pip install coverage'.") - exit("coverage is not installed") + exit("Coverage is not installed. Please install it using 'pip install coverage'.") # Set dir to test dir: test_directory = os.path.dirname(os.path.abspath(__file__)) # Run tests with coverage - subprocess.run(["coverage", "run", "-m", "unittest", "discover"],cwd = test_directory) + subprocess.run(["coverage", "run", "-m", "unittest", + "discover"], cwd=test_directory) # Generate coverage report - subprocess.run(["coverage", "report"],cwd = test_directory) - subprocess.run(["coverage", "html"],cwd = test_directory) + subprocess.run(["coverage", "report"], cwd=test_directory) + subprocess.run(["coverage", "html"], cwd=test_directory) + if __name__ == "__main__": - run_tests() \ No newline at end of file + run_tests()