Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code quality errors #265

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import math
import textwrap
import dataclasses
import sys

try:
import wcwidth # optional wide-character (CJK) support
Expand Down Expand Up @@ -1352,9 +1353,7 @@ def _normalize_tabular_data(tabular_data, headers, showindex="default"):

try:
bool(headers)
is_headers2bool_broken = False # noqa
except ValueError: # numpy.ndarray, pandas.core.index.Index, ...
is_headers2bool_broken = True # noqa
arpitjain099 marked this conversation as resolved.
Show resolved Hide resolved
headers = list(headers)

index = None
Expand Down Expand Up @@ -2646,8 +2645,6 @@ def _main():
(default: simple)
"""
import getopt
import sys
import textwrap

usage = textwrap.dedent(_main.__doc__)
try:
Expand Down
2 changes: 0 additions & 2 deletions test/common.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import pytest # noqa
from pytest import skip, raises # noqa
arpitjain099 marked this conversation as resolved.
Show resolved Hide resolved


def assert_equal(expected, result):
print("Expected:\n%s\n" % expected)
print("Got:\n%s\n" % result)
assert expected == result


def assert_in(result, expected_set):
nums = range(1, len(expected_set) + 1)
for i, expected in zip(nums, expected_set):
Expand Down