Skip to content

Commit cdb1a01

Browse files
authored
Test current versions of Python on multiple macOS versions (#12)
* tox.ini: Test current versions of Python https://devguide.python.org/versions * tests.yml: matrix.os: [macos-10.15, macos-11, macos-12] * Update tests.yml * setup.cfg: Allow example.py to print() * Fail fast if plist.discover_filename() returns None * com.apple.kextd was removed in macOS v11
1 parent d00ac7c commit cdb1a01

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.github/workflows/tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
- pull_request
77

88
jobs:
9-
test-macos-1015:
10-
runs-on: macos-10.15
9+
test:
10+
strategy:
11+
fail-fast: false
12+
matrix: # https://github.com/actions/runner-images#available-images
13+
os: [macos-10.15, macos-11, macos-12]
14+
runs-on: ${{ matrix.os }}
1115
steps:
1216
- uses: actions/checkout@v3
1317
- name: Install dependencies
@@ -16,4 +20,4 @@ jobs:
1620
python3 -m pip install --upgrade pip
1721
pip3 install tox
1822
- name: Test with tox
19-
run: tox -e py39,style
23+
run: tox -e py,style

launchd/tests/plist.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,22 @@ def test_compute_filename(self):
3838
self.assertTrue(fname.startswith("/System/Library/LaunchDaemons/"))
3939

4040
@unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X")
41+
@unittest.skipIf(sys.version_info >= (3, 11), "com.apple.kextd was removed in macOS v11")
4142
def test_discover_filename(self):
4243
fname = plist.discover_filename("com.apple.kextd", plist.DAEMON_OS)
44+
self.assertIsNotNone(fname)
4345
self.assertTrue(os.path.isfile(fname))
4446

4547
# no scope specified
4648
fname2 = plist.discover_filename("com.apple.kextd")
49+
self.assertIsNotNone(fname)
4750
self.assertTrue(os.path.isfile(fname2))
4851

4952
fname = plist.discover_filename("com.apple.kextd", plist.USER)
50-
self.assertEqual(None, fname)
53+
self.assertIsNone(fname)
5154

5255
@unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X")
56+
@unittest.skipIf(sys.version_info >= (3, 11), "com.apple.kextd was removed in macOS v11")
5357
def test_read(self):
5458
result = plist.read("com.apple.kextd", plist.DAEMON_OS)
5559
self.assertIsInstance(result, dict)

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ exclude = .git,__pycache__,build,dist,.tox,.eggs,.direnv
44
max_line_length = 120
55
# flake8-quotes:
66
inline-quotes = double
7+
per-file-ignores =
8+
example.py:T201
79

810
[check-manifest]
911
# https://pypi.python.org/pypi/check-manifest

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Tox (http://tox.testrun.org/)
22

33
[tox]
4-
envlist = py34, py35, py36, py37, py38, py39
4+
envlist = py37, py38, py39, py310, py311
55

66
[testenv]
77
deps = coverage

0 commit comments

Comments
 (0)