Skip to content

Commit

Permalink
ci: Add pipe tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 28, 2024
1 parent 5cdead2 commit a8aac11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ jobs:
csvstat < examples/dummy.csv
in2csv -f csv < examples/dummy.csv
sql2csv < examples/test.sql
- name: Read from pipe
run: |
printf 'a,b,c\n1,2,3' | csvclean
printf 'a,b,c\n1,2,3' | csvcut
printf 'a,b,c\n1,2,3' | csvformat
printf 'a,b,c\n1,2,3' | csvgrep -c1 -m1
printf 'a,b,c\n1,2,3' | csvjoin
printf 'a,b,c\n1,2,3' | csvjson
printf 'a,b,c\n1,2,3' | csvlook
printf 'a,b,c\n1,2,3' | csvsort
printf 'a,b,c\n1,2,3' | csvsql
printf 'a,b,c\n1,2,3' | csvstack
printf 'a,b,c\n1,2,3' | csvstat
printf 'a,b,c\n1,2,3' | in2csv -f csv
printf 'SELECT 1 AS a' | sql2csv
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
1 change: 1 addition & 0 deletions csvkit/utilities/in2csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def add_arguments(self):
'-I', '--no-inference', dest='no_inference', action='store_true',
help='Disable type inference (and --locale, --date-format, --datetime-format) when parsing CSV input.')

# This is called only from open_excel_input_file(), but is a separate method to use caching.
@functools.lru_cache
def stdin(self):
return sys.stdin.buffer.read()
Expand Down

0 comments on commit a8aac11

Please sign in to comment.