Repository: identique/idnumbers (language: python)

Issue:
Remove the test cases from packaging phase
We use `python -m build` to build the release package. It includes useless test cases. We should remove all of them while building the package.

It might relates to the line `packages=find_packages(exclude=['test_*']),` of the setup.py



Discussion / hints:

Fix patch:
diff --git a/setup.py b/setup.py
index dc456011..f2038595 100644
--- a/setup.py
+++ b/setup.py
@@ -25,7 +25,7 @@ def read(filename):
         'Source': 'https://github.com/microdataxyz/idnumbers',
         'Tracker': 'https://github.com/microdataxyz/idnumbers/issues',
     },
-    packages=find_packages(exclude=['test_*']),
+    packages=find_packages(exclude=['*tests*']),
     data_files=[('version', ['VERSION'])],
     python_requires='>=3.9',
     install_requires=[],


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/tests/nationalid/__init__.py b/tests/nationalid/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/idnumbers/nationalid/test_ARE.py b/tests/nationalid/test_ARE.py
similarity index 100%
rename from idnumbers/nationalid/test_ARE.py
rename to tests/nationalid/test_ARE.py
diff --git a/idnumbers/nationalid/test_ARG.py b/tests/nationalid/test_ARG.py
similarity index 100%
rename from idnumbers/nationalid/test_ARG.py
rename to tests/nationalid/test_ARG.py
diff --git a/idnumbers/nationalid/test_AUS.py b/tests/nationalid/test_AUS.py
similarity index 100%
rename from idnumbers/nationalid/test_AUS.py
rename to tests/nationalid/test_AUS.py
diff --git a/idnumbers/nationalid/test_BEL.py b/tests/nationalid/test_BEL.py
similarity index 100%
rename from idnumbers/nationalid/test_BEL.py
rename to tests/nationalid/test_BEL.py
diff --git a/idnumbers/nationalid/test_BRA.py b/tests/nationalid/test_BRA.py
similarity index 100%
rename from idnumbers/nationalid/test_BRA.py
rename to tests/nationalid/test_BRA.py
diff --git a/idnumbers/nationalid/test_CAN.py b/tests/nationalid/test_CAN.py
similarity index 100%
rename from idnumbers/nationalid/test_CAN.py
rename to tests/nationalid/test_CAN.py
diff --git a/idnumbers/nationalid/test_CHE.py b/tests/nationalid/test_CHE.py
similarity index 100%
rename from idnumbers/nationalid/test_CHE.py
rename to tests/nationalid/test_CHE.py
diff --git a/idnumbers/nationalid/test_CHL.py b/tests/nationalid/test_CHL.py
similarity index 100%
rename from idnumbers/nationalid/test_CHL.py
rename to tests/nationalid/test_CHL.py
diff --git a/idnumbers/nationalid/test_CHN.py b/tests/nationalid/test_CHN.py
similarity index 100%
rename from idnumbers/nationalid/test_CHN.py
rename to tests/nationalid/test_CHN.py
diff --git a/idnumbers/nationalid/test_DEU.py b/tests/nationalid/test_DEU.py
similarity index 100%
rename from idnumbers/nationalid/test_DEU.py
rename to tests/nationalid/test_DEU.py
diff --git a/idnumbers/nationalid/test_ESP.py b/tests/nationalid/test_ESP.py
similarity index 100%
rename from idnumbers/nationalid/test_ESP.py
rename to tests/nationalid/test_ESP.py
diff --git a/idnumbers/nationalid/test_FIN.py b/tests/nationalid/test_FIN.py
similarity index 100%
rename from idnumbers/nationalid/test_FIN.py
rename to tests/nationalid/test_FIN.py
diff --git a/idnumbers/nationalid/test_FRA.py b/tests/nationalid/test_FRA.py
similarity index 94%
rename from idnumbers/nationalid/test_FRA.py
rename to tests/nationalid/test_FRA.py
index 53cd9da3..19713021 100644
--- a/idnumbers/nationalid/test_FRA.py
+++ b/tests/nationalid/test_FRA.py
@@ -1,6 +1,6 @@
 from unittest import TestCase, main
 
-from .constant import Gender
+from idnumbers.nationalid.constant import Gender
 from idnumbers.nationalid import FRA
 
 
diff --git a/idnumbers/nationalid/test_GBR.py b/tests/nationalid/test_GBR.py
similarity index 100%
rename from idnumbers/nationalid/test_GBR.py
rename to tests/nationalid/test_GBR.py
diff --git a/idnumbers/nationalid/test_HKG.py b/tests/nationalid/test_HKG.py
similarity index 100%
rename from idnumbers/nationalid/test_HKG.py
rename to tests/nationalid/test_HKG.py
diff --git a/idnumbers/nationalid/test_IDN.py b/tests/nationalid/test_IDN.py
similarity index 100%
rename from idnumbers/nationalid/test_IDN.py
rename to tests/nationalid/test_IDN.py
diff --git a/idnumbers/nationalid/test_IND.py b/tests/nationalid/test_IND.py
similarity index 100%
rename from idnumbers/nationalid/test_IND.py
rename to tests/nationalid/test_IND.py
diff --git a/idnumbers/nationalid/test_IRL.py b/tests/nationalid/test_IRL.py
similarity index 100%
rename from idnumbers/nationalid/test_IRL.py
rename to tests/nationalid/test_IRL.py
diff --git a/idnumbers/nationalid/test_ITA.py b/tests/nationalid/test_ITA.py
similarity index 100%
rename from idnumbers/nationalid/test_ITA.py
rename to tests/nationalid/test_ITA.py
diff --git a/idnumbers/nationalid/test_JPN.py b/tests/nationalid/test_JPN.py
similarity index 100%
rename from idnumbers/nationalid/test_JPN.py
rename to tests/nationalid/test_JPN.py
diff --git a/idnumbers/nationalid/test_KOR.py b/tests/nationalid/test_KOR.py
similarity index 100%
rename from idnumbers/nationalid/test_KOR.py
rename to tests/nationalid/test_KOR.py
diff --git a/idnumbers/nationalid/test_LKA.py b/tests/nationalid/test_LKA.py
similarity index 100%
rename from idnumbers/nationalid/test_LKA.py
rename to tests/nationalid/test_LKA.py
diff --git a/idnumbers/nationalid/test_MEX.py b/tests/nationalid/test_MEX.py
similarity index 100%
rename from idnumbers/nationalid/test_MEX.py
rename to tests/nationalid/test_MEX.py
diff --git a/idnumbers/nationalid/test_MYS.py b/tests/nationalid/test_MYS.py
similarity index 100%
rename from idnumbers/nationalid/test_MYS.py
rename to tests/nationalid/test_MYS.py
diff --git a/idnumbers/nationalid/test_NGA.py b/tests/nationalid/test_NGA.py
similarity index 100%
rename from idnumbers/nationalid/test_NGA.py
rename to tests/nationalid/test_NGA.py
diff --git a/idnumbers/nationalid/test_NLD.py b/tests/nationalid/test_NLD.py
similarity index 100%
rename from idnumbers/nationalid/test_NLD.py
rename to tests/nationalid/test_NLD.py
diff --git a/idnumbers/nationalid/test_NOR.py b/tests/nationalid/test_NOR.py
similarity index 92%
rename from idnumbers/nationalid/test_NOR.py
rename to tests/nationalid/test_NOR.py
index c9cc6586..e1a1c202 100644
--- a/idnumbers/nationalid/test_NOR.py
+++ b/tests/nationalid/test_NOR.py
@@ -2,7 +2,7 @@
 from datetime import date
 
 from idnumbers.nationalid import NOR
-from .constant import Gender
+from idnumbers.nationalid.constant import Gender
 
 
 class TestNORValidation(TestCase):
diff --git a/idnumbers/nationalid/test_NZL.py b/tests/nationalid/test_NZL.py
similarity index 100%
rename from idnumbers/nationalid/test_NZL.py
rename to tests/nationalid/test_NZL.py
diff --git a/idnumbers/nationalid/test_PHL.py b/tests/nationalid/test_PHL.py
similarity index 100%
rename from idnumbers/nationalid/test_PHL.py
rename to tests/nationalid/test_PHL.py
diff --git a/idnumbers/nationalid/test_POL.py b/tests/nationalid/test_POL.py
similarity index 100%
rename from idnumbers/nationalid/test_POL.py
rename to tests/nationalid/test_POL.py
diff --git a/idnumbers/nationalid/test_PRT.py b/tests/nationalid/test_PRT.py
similarity index 100%
rename from idnumbers/nationalid/test_PRT.py
rename to tests/nationalid/test_PRT.py
diff --git a/idnumbers/nationalid/test_SGP.py b/tests/nationalid/test_SGP.py
similarity index 100%
rename from idnumbers/nationalid/test_SGP.py
rename to tests/nationalid/test_SGP.py
diff --git a/idnumbers/nationalid/test_SWE.py b/tests/nationalid/test_SWE.py
similarity index 95%
rename from idnumbers/nationalid/test_SWE.py
rename to tests/nationalid/test_SWE.py
index 831961fb..cfd6faa7 100644
--- a/idnumbers/nationalid/test_SWE.py
+++ b/tests/nationalid/test_SWE.py
@@ -1,5 +1,5 @@
 from unittest import TestCase, main
-from .constant import Gender
+from idnumbers.nationalid.constant import Gender
 
 from idnumbers.nationalid import SWE
 
diff --git a/idnumbers/nationalid/test_THA.py b/tests/nationalid/test_THA.py
similarity index 100%
rename from idnumbers/nationalid/test_THA.py
rename to tests/nationalid/test_THA.py
diff --git a/idnumbers/nationalid/test_TUR.py b/tests/nationalid/test_TUR.py
similarity index 100%
rename from idnumbers/nationalid/test_TUR.py
rename to tests/nationalid/test_TUR.py
diff --git a/idnumbers/nationalid/test_TWN.py b/tests/nationalid/test_TWN.py
similarity index 100%
rename from idnumbers/nationalid/test_TWN.py
rename to tests/nationalid/test_TWN.py
diff --git a/idnumbers/nationalid/test_UKR.py b/tests/nationalid/test_UKR.py
similarity index 100%
rename from idnumbers/nationalid/test_UKR.py
rename to tests/nationalid/test_UKR.py
diff --git a/idnumbers/nationalid/test_USA.py b/tests/nationalid/test_USA.py
similarity index 100%
rename from idnumbers/nationalid/test_USA.py
rename to tests/nationalid/test_USA.py
diff --git a/idnumbers/nationalid/test_VNM.py b/tests/nationalid/test_VNM.py
similarity index 100%
rename from idnumbers/nationalid/test_VNM.py
rename to tests/nationalid/test_VNM.py
diff --git a/idnumbers/nationalid/test_ZAF.py b/tests/nationalid/test_ZAF.py
similarity index 100%
rename from idnumbers/nationalid/test_ZAF.py
rename to tests/nationalid/test_ZAF.py
diff --git a/idnumbers/nationalid/test_ZWE.py b/tests/nationalid/test_ZWE.py
similarity index 100%
rename from idnumbers/nationalid/test_ZWE.py
rename to tests/nationalid/test_ZWE.py