Skip to content

Commit

Permalink
Test Python 3.12 beta (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 8, 2023
1 parent f953e06 commit f5a2937
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand All @@ -21,6 +21,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: "pyproject.toml"

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version"]

Expand Down
1 change: 0 additions & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pytest-cov
MarkupPy
odfpy
openpyxl>=2.6.0
pandas
pyyaml
tabulate
xlrd
Expand Down
10 changes: 10 additions & 0 deletions tests/test_tablib.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from pathlib import Path
from uuid import uuid4

import pytest
from MarkupPy import markup
from openpyxl.reader.excel import load_workbook

Expand All @@ -21,6 +22,11 @@
from tablib.exceptions import UnsupportedFormat
from tablib.formats import registry

try:
import pandas
except ImportError: # pragma: no cover
pandas = None


class BaseTestCase(unittest.TestCase):
def setUp(self):
Expand Down Expand Up @@ -264,6 +270,7 @@ def test_str_no_columns(self):
'c|3'
])

@pytest.mark.skipif(pandas is None, reason="pandas is not installed")
def test_unicode_append(self):
"""Passes in a single unicode character and exports."""

Expand All @@ -272,6 +279,7 @@ def test_unicode_append(self):
data.append(new_row)
self._test_export_data_in_all_formats(data)

@pytest.mark.skipif(pandas is None, reason="pandas is not installed")
def test_datetime_append(self):
"""Passes in a single datetime and a single date and exports."""

Expand All @@ -283,6 +291,7 @@ def test_datetime_append(self):
data.append(new_row)
self._test_export_data_in_all_formats(data)

@pytest.mark.skipif(pandas is None, reason="pandas is not installed")
def test_separator_append(self):
for a in range(3):
data.append_separator('foobar')
Expand Down Expand Up @@ -328,6 +337,7 @@ def test_empty_file(self):
dset = tablib.Dataset().load(tmp_file, 'yaml')
self.assertEqual(dset.json, '[]')

@pytest.mark.skipif(pandas is None, reason="pandas is not installed")
def test_auto_format_detect(self):
"""Test auto format detection."""
# html, jira, latex, rst are export only.
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ minversion = 2.4
envlist =
docs
lint
py{37,38,39,310,311}
py{37,38,39,310,311,312}

[testenv]
deps =
-rtests/requirements.txt
extras = pandas
commands_pre =
- {envpython} -m pip install --only-binary :all: pandas
passenv =
FORCE_COLOR
commands =
Expand Down

0 comments on commit f5a2937

Please sign in to comment.