Skip to content

Commit

Permalink
Also use pytest in github actions. Drop 3.7 from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed Oct 24, 2024
1 parent 1d46264 commit 2e5359e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 93 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
- macos-latest

python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
Expand All @@ -39,9 +38,9 @@ jobs:
- name: Run tests
run: |
python --version
python -m yafowil.tests.__init__
python -m pytest yafowil/tests
- name: Run coverage
run: |
coverage run --source=src/yafowil -m yafowil.tests.__init__
coverage run --source=src/yafowil -m pytest yafowil/tests
coverage report -m --fail-under=99
14 changes: 0 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test
import os


Expand All @@ -18,13 +17,6 @@ def read_file(name):
]])


class Test(test):

def run_tests(self):
from yafowil import tests
tests.run_tests()


setup(
name='yafowil',
version=version,
Expand Down Expand Up @@ -59,12 +51,6 @@ def run_tests(self):
'setuptools',
'webresource'
],
tests_require=[
'coverage',
'lxml',
'zope.testrunner'
],
test_suite='yafowil.tests.test_suite',
extras_require=dict(test=[
'coverage',
'lxml',
Expand Down
77 changes: 1 addition & 76 deletions src/yafowil/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from importlib import reload
from node.tests import NodeTestCase
from yafowil import button
Expand All @@ -25,8 +24,6 @@
from yafowil.base import factory
from yafowil.utils import Tag
import lxml.etree as etree
import sys
import unittest


class YafowilTestCase(NodeTestCase):
Expand Down Expand Up @@ -71,76 +68,4 @@ def wrapped_fxml(value):
return fxml(u'<div>' + value + u'</div>')


tag = Tag(lambda msg: msg)


def test_suite():
from yafowil.tests import test_base
from yafowil.tests import test_button
from yafowil.tests import test_checkbox
from yafowil.tests import test_common
from yafowil.tests import test_compound
from yafowil.tests import test_controller
from yafowil.tests import test_datatypes
from yafowil.tests import test_email
from yafowil.tests import test_field
from yafowil.tests import test_file
from yafowil.tests import test_hidden
from yafowil.tests import test_lines
from yafowil.tests import test_number
from yafowil.tests import test_password
from yafowil.tests import test_persistence
from yafowil.tests import test_proxy
from yafowil.tests import test_resources
from yafowil.tests import test_search
from yafowil.tests import test_select
from yafowil.tests import test_table
from yafowil.tests import test_tag
from yafowil.tests import test_text
from yafowil.tests import test_textarea
from yafowil.tests import test_tsf
from yafowil.tests import test_url
from yafowil.tests import test_utils

suite = unittest.TestSuite()

suite.addTest(unittest.findTestCases(test_base))
suite.addTest(unittest.findTestCases(test_button))
suite.addTest(unittest.findTestCases(test_checkbox))
suite.addTest(unittest.findTestCases(test_common))
suite.addTest(unittest.findTestCases(test_compound))
suite.addTest(unittest.findTestCases(test_controller))
suite.addTest(unittest.findTestCases(test_datatypes))
suite.addTest(unittest.findTestCases(test_email))
suite.addTest(unittest.findTestCases(test_field))
suite.addTest(unittest.findTestCases(test_file))
suite.addTest(unittest.findTestCases(test_hidden))
suite.addTest(unittest.findTestCases(test_lines))
suite.addTest(unittest.findTestCases(test_number))
suite.addTest(unittest.findTestCases(test_password))
suite.addTest(unittest.findTestCases(test_persistence))
suite.addTest(unittest.findTestCases(test_proxy))
suite.addTest(unittest.findTestCases(test_resources))
suite.addTest(unittest.findTestCases(test_search))
suite.addTest(unittest.findTestCases(test_select))
suite.addTest(unittest.findTestCases(test_table))
suite.addTest(unittest.findTestCases(test_tag))
suite.addTest(unittest.findTestCases(test_text))
suite.addTest(unittest.findTestCases(test_textarea))
suite.addTest(unittest.findTestCases(test_tsf))
suite.addTest(unittest.findTestCases(test_url))
suite.addTest(unittest.findTestCases(test_utils))

return suite


def run_tests():
from zope.testrunner.runner import Runner

runner = Runner(found_suites=[test_suite()])
runner.run()
sys.exit(int(runner.failed))


if __name__ == '__main__':
run_tests()
tag = Tag(lambda msg: msg)

0 comments on commit 2e5359e

Please sign in to comment.