Skip to content

Commit 9fe7939

Browse files
committed
ci: Test the petl executable
- adds a simple test invoking the petl executable - installs the package in CI so the executable is available.
1 parent 1e77626 commit 9fe7939

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

.github/workflows/test-changes.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
run: |
9292
python -m pip install --upgrade pip
9393
python -m pip install --prefer-binary -r requirements-tests.txt
94+
python -m pip install -e .
9495
9596
- name: Setup environment variables for remote filesystem testing
9697
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.8'

petl/test/test_executable.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from __future__ import print_function, division, absolute_import
2+
3+
import subprocess
4+
5+
def test_executable():
6+
result = subprocess.run("""
7+
(echo foo,bar ; echo a,b; echo c,d) |
8+
petl 'fromcsv().cut("foo").head(1).tocsv()'
9+
""", shell=True, check=True, capture_output=True)
10+
assert result.stdout == b'foo\r\na\r\n'

0 commit comments

Comments
 (0)