Skip to content

Commit

Permalink
Update locale in VASP tests to work on WSL
Browse files Browse the repository at this point in the history
  • Loading branch information
kavanase committed Jul 10, 2024
1 parent f407abb commit aae87d3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions tests/test_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1118,12 +1118,8 @@ def setUp(self):
# settings):
self.CdTe_custom_test_incar_settings = {"ENCUT": 350, "NCORE": 10, "LVHAR": False, "ALGO": "All"}

# Get the current locale setting
self.original_locale = locale.getlocale(locale.LC_CTYPE) # should be UTF-8

def tearDown(self):
# reset locale:
locale.setlocale(locale.LC_CTYPE, self.original_locale) # should be UTF-8
locale.setlocale(locale.LC_ALL, "") # reset locale

for file in os.listdir():
if file.endswith(".json.gz"):
Expand Down Expand Up @@ -1413,7 +1409,7 @@ def test_write_files_ASCII_encoding(self):
user_incar_settings=self.CdTe_custom_test_incar_settings,
)
defects_set.write_files(potcar_spec=True, vasp_gam=True, unperturbed_poscar=True)
locale.setlocale(locale.LC_CTYPE, self.original_locale) # should be UTF-8
locale.setlocale(locale.LC_ALL, "") # resets locale

# assert that the same folders in self.CdTe_data_dir are present in the current directory
self.check_generated_vasp_inputs( # tests vasp_gam
Expand Down

0 comments on commit aae87d3

Please sign in to comment.