Skip to content

Commit

Permalink
wip merging in beeprint
Browse files Browse the repository at this point in the history
  • Loading branch information
hjwp committed Nov 8, 2023
1 parent e817937 commit 94b0e15
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- name: Test
shell: 'script -q -e -c "bash {0}"'
run: |
stty cols 90
pytest
stty cols 100
COLUMNS=100 pytest
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
7 changes: 7 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
History
-------

* WARNING: history poorly maintained.

0.8 (2023-10)
~~~~~~~~~~~~

* merge in pytest-beeprint fork. thanks!

0.3 (2020-01-28)
~~~~~~~~~~~~~~~~

Expand Down
Binary file modified example_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion pytest_icdiff.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# pylint: disable=inconsistent-return-statements
import shutil
from pprintpp import pformat

import icdiff
from beeprint import pp

COLS = shutil.get_terminal_size().columns
MARGIN_L = 10
GUTTER = 2
MARGINS = MARGIN_L + GUTTER + 1

def pformat(*args, **kwargs) -> str: # temporary wrapper to minimise diff
return pp(*args, **kwargs, output=False)


# def _debug(*things):
# with open('/tmp/icdiff-debug.txt', 'a') as f:
# f.write(' '.join(str(thing) for thing in things))
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import codecs
import os

from setuptools import setup


Expand All @@ -13,7 +14,7 @@ def read(fname):

setup(
name="pytest-icdiff",
version="0.7",
version="0.8",
author="Harry Percival",
author_email="[email protected]",
maintainer="Harry Percival",
Expand All @@ -25,7 +26,7 @@ def read(fname):
long_description_content_type="text/x-rst",
py_modules=["pytest_icdiff"],
python_requires=">=3.7",
install_requires=["pytest", "icdiff", "pprintpp"],
install_requires=["pytest", "icdiff", "beeprint"],
classifiers=[
"Development Status :: 4 - Beta",
"Framework :: Pytest",
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest_plugins = 'pytester'
pytest_plugins = "pytester"
6 changes: 3 additions & 3 deletions tests/test_pytest_icdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest import mock
import pytest
import re
from pprintpp import pformat
from beeprint import pp

YELLOW_ON = '\x1b[1;33m'
COLOR_OFF = '\x1b[m'
Expand Down Expand Up @@ -159,8 +159,8 @@ def test_thing():
)
output = testdir.runpytest('--color=yes').stdout.str()
expected = list(icdiff.ConsoleDiff().make_table(
pformat(one, width=1).splitlines(),
pformat(two, width=1).splitlines(),
pp(one, width=1, output=False).splitlines(),
pp(two, width=1, output=False).splitlines(),
))
print('\n'.join(repr(l) for l in output.splitlines()))
_assert_line_in_ignoring_whitespace(expected[0], output)
Expand Down

0 comments on commit 94b0e15

Please sign in to comment.