Skip to content

Commit

Permalink
removed Python 2 code from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst committed Jun 15, 2024
1 parent 8db674a commit c914e00
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 31 deletions.
2 changes: 0 additions & 2 deletions tests/test_cbook.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import os.path
import re

Expand Down
4 changes: 0 additions & 4 deletions tests/test_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import six

import pytest

import gromacs
Expand Down
7 changes: 1 addition & 6 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,12 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import contextlib
import os
import errno
import sys

if sys.version_info[0] < 3:
from ConfigParser import NoOptionError, NoSectionError
else:
from configparser import NoOptionError, NoSectionError
from configparser import NoOptionError, NoSectionError

import pytest

Expand Down
9 changes: 1 addition & 8 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import six

import os.path
import pytest

Expand Down Expand Up @@ -73,10 +69,7 @@ def test_run_with_input(self, command, inp):
def test_Popen_with_input(self, command, inp):
po = command.Popen(stdout=False, stderr=False, input=inp)
inp_string = "\n".join(gromacs.utilities.asiterable(inp)) + "\n"
if six.PY2:
assert po.input == inp_string.encode("utf-8")
else:
assert po.input == inp_string
assert po.input == inp_string

def test_help_short(self, command, capsys):
command.help()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import time
import pytest
import os
Expand Down
2 changes: 0 additions & 2 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import os.path
import pytest

Expand Down
2 changes: 0 additions & 2 deletions tests/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import pytest

import gromacs
Expand Down
8 changes: 3 additions & 5 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.

from __future__ import division, absolute_import, print_function

import os.path
import pytest
from six.moves import cPickle as pickle
from six.moves import StringIO
from six.moves.collections_abc import Iterable
import pickle
from io import StringIO
from collections.abc import Iterable

import numpy as np

Expand Down

0 comments on commit c914e00

Please sign in to comment.