Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip' # caching pip dependencies
- run: python -m pip install -r requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
run: python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Coveralls
Expand Down
2 changes: 1 addition & 1 deletion tests/test_crossrefs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


from . import testing
from tests import testing


class CrossSheetTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_evaluator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest

from xlcalculator import evaluator, model
from . import testing
from tests import testing


class TestEvaluator(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from xlcalculator.tokenizer import f_token
from xlcalculator import Evaluator

from . import testing
from tests import testing


class ModelTest(testing.XlCalculatorTestCase):
Expand Down
7 changes: 2 additions & 5 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import unittest

from xlcalculator import reader, xltypes, tokenizer
from . import testing
from tests import testing


class ReaderTest(unittest.TestCase):
Expand Down Expand Up @@ -47,8 +47,5 @@ def test_read_defined_names(self):
archive.read()
defined_names = archive.read_defined_names()

its_a_blank = (
set(sorted(defined_names.keys()))
- set(sorted(self.defined_names.keys()))
)
its_a_blank = (set(sorted(defined_names.keys())) - set(sorted(self.defined_names.keys())))
self.assertEqual(list(its_a_blank), ['Its_a_blank'])
2 changes: 1 addition & 1 deletion tests/test_tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from xlcalculator.tokenizer import f_token, ExcelParser

from . import testing
from tests import testing


class ExcelParserTest(testing.XlCalculatorTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_xltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from xlcalculator import xltypes
from xlcalculator.tokenizer import f_token

from . import testing
from tests import testing


class XLFormulaTest(testing.XlCalculatorTestCase):
Expand Down
14 changes: 14 additions & 0 deletions tests/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,17 @@ def setUp(self):
self.model = compiler.read_and_parse_archive(
get_resource(self.filename))
self.evaluator = evaluator.Evaluator(self.model)


if __name__ == "__main__":
from pathlib import Path
p_dir = Path(__file__).parent
# Discover all tests in the current directory
test_loader = unittest.defaultTestLoader
test_suite = test_loader.discover(start_dir=p_dir, pattern="*.py")

# Create a test runner
test_runner = unittest.TextTestRunner()

# Run the tests
test_runner.run(test_suite)
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/abs_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ABSTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/acos_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ACOSTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/asin_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ASINTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/atan2_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ATAN2Test(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/atan_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ATANTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/average_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class AverageTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/ceiling_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CEILINGTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/choose_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ChooseTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/concat_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ConcatTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/concatenate_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ConcatenateTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/cos_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class COSTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/cosh_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class COSHTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/count_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/counta_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountaTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/countif_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountIfTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/countifs_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountIfsTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/date_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class DateTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/datedif_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class DatedifTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/day_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class DayTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/days_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class DaysTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/double_minus_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class DoubleMinusTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/edate_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class EDateTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/engineering_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class SumTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/eomonth_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class EDateTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/exact_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ExactTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/find_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class FindTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/if_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountIfTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/information_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class InformationTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/int_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class IntTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/irr_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class IRRTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/len_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class LenTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/ln_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class LnTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/match_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class MatchTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/max_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class MaxTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/mid_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class MidTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/min_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class MinTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/mod_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class ModTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/month_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class MonthTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/not_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class CountIfTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/npv_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class NPVTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/pmt_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class PMTTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/power_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class PowerTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/right_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class RightTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/round_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class RoundTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/rounddown_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class RounddownTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/roundup_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class RoundupTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/sln_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class SLNTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/sqrt_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing

from xlcalculator.xlfunctions import xlerrors

Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/sum_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class SumTest(testing.FunctionalTestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/xlfunctions_vs_excel/sumifs_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .. import testing
from tests import testing


class SumIfsTest(testing.FunctionalTestCase):
Expand Down
Loading