Skip to content

Commit

Permalink
Fix tests for python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Nov 10, 2023
1 parent f32a4df commit 552e7a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os
from shutil import copytree
from shutil import copytree, rmtree

from pytest import fixture

Expand All @@ -15,6 +15,7 @@ def datadir(tmp_path, request):
test_dir, _ = os.path.splitext(filename)

if os.path.isdir(test_dir):
copytree(test_dir, str(tmp_path), dirs_exist_ok=True)
rmtree(tmp_path)
copytree(test_dir, str(tmp_path))

return tmp_path
5 changes: 3 additions & 2 deletions tests/test_TiO2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals

import os
from shutil import copytree
from shutil import copytree, rmtree

import numpy as np
from pytest import fixture
Expand All @@ -22,7 +22,8 @@ def datadir(tmpdir, request):
test_dir, _ = os.path.splitext(filename)

if os.path.isdir(test_dir):
copytree(test_dir, str(tmpdir), dirs_exist_ok=True)
rmtree(tmpdir)
copytree(test_dir, str(tmpdir))

return tmpdir

Expand Down
5 changes: 3 additions & 2 deletions tests/test_dispersions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Tests for dispersion models"""
import os
from shutil import copytree
from shutil import copytree, rmtree

import numpy as np
import pandas as pd
Expand All @@ -19,7 +19,8 @@ def datadir(tmpdir, request):
test_dir, _ = os.path.splitext(filename)

if os.path.isdir(test_dir):
copytree(test_dir, str(tmpdir), dirs_exist_ok=True)
rmtree(tmpdir)
copytree(test_dir, str(tmpdir))

return tmpdir

Expand Down

0 comments on commit 552e7a0

Please sign in to comment.