Skip to content

Commit

Permalink
ci: Test the petl executable
Browse files Browse the repository at this point in the history
 - adds a simple test invoking the petl executable
 - installs the package in CI so the executable is available.
  • Loading branch information
yaniv-aknin committed May 12, 2024
1 parent 1e77626 commit 9fe7939
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install --prefer-binary -r requirements-tests.txt
python -m pip install -e .
- name: Setup environment variables for remote filesystem testing
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.8'
Expand Down
10 changes: 10 additions & 0 deletions petl/test/test_executable.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from __future__ import print_function, division, absolute_import

import subprocess

def test_executable():
result = subprocess.run("""
(echo foo,bar ; echo a,b; echo c,d) |
petl 'fromcsv().cut("foo").head(1).tocsv()'
""", shell=True, check=True, capture_output=True)
assert result.stdout == b'foo\r\na\r\n'

0 comments on commit 9fe7939

Please sign in to comment.