Skip to content

Commit

Permalink
Migrate tests from nosetests to pytest
Browse files Browse the repository at this point in the history
nosetests doesn't work with Python >= 3.10
  • Loading branch information
Maratyszcza committed Dec 27, 2023
1 parent 059c4ab commit 8d8f7b4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 31 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@ jobs:

strategy:
matrix:
python-version: ["3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install package
run: |
python -m pip install --upgrade pip
- name: Test with nosetests
python -m pip install .
- name: Test with pytest
run: |
pip install nose
nosetests
pip install -r test/requirements.txt
pytest
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def read_text_file(path):
"Operating System :: OS Independent",
"Programming Language :: Assembly",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
Expand Down
2 changes: 1 addition & 1 deletion test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nose
pytest
11 changes: 3 additions & 8 deletions test/test_k1om.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import unittest


class ReadXML(unittest.TestCase):
def runTest(self):
from opcodes.k1om import read_instruction_set
instruction_set = read_instruction_set()

def test_read_instruction_set():
from opcodes.k1om import read_instruction_set
instruction_set = read_instruction_set()
11 changes: 3 additions & 8 deletions test/test_x86.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import unittest


class ReadXML(unittest.TestCase):
def runTest(self):
from opcodes.x86 import read_instruction_set
instruction_set = read_instruction_set()

def test_read_instruction_set():
from opcodes.x86 import read_instruction_set
instruction_set = read_instruction_set()
11 changes: 3 additions & 8 deletions test/test_x86_64.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import unittest


class ReadXML(unittest.TestCase):
def runTest(self):
from opcodes.x86_64 import read_instruction_set
instruction_set = read_instruction_set()

def test_read_instruction_set():
from opcodes.x86_64 import read_instruction_set
instruction_set = read_instruction_set()

0 comments on commit 8d8f7b4

Please sign in to comment.