Skip to content
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
27 changes: 27 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run Python Tests
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
strategy:
matrix:
python_version: ["2.7", "3.3", "3.4", "3.5", "3.6", "3.7", "3.8", "pypy2", "pypy3"]
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt --user
- name: Run tests with Nose
run: python -m nose --exclude=test_suite
14 changes: 0 additions & 14 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion mf2py/dom_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def text_collection(el, replace_img=False, img_to_src=True, base_url=''):

return items

results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t is not '']
results = [t for t in text_collection(el, replace_img, img_to_src, base_url) if t != '']

if results:
# remove <space> if it is first and last or if it is preceded by a <space> or <p> open/close
Expand Down
6 changes: 3 additions & 3 deletions mf2py/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def parse_props(el):

if root_class_names:
parsed_types_aggregation.add('h')

# Is this a property element (p-*, u-*, etc.) flag
# False is default
is_property_el = False
Expand Down Expand Up @@ -384,7 +384,7 @@ def parse_rels(el):

# 1st one wins
if "text" not in value_dict:
value_dict["text"] = el.get_text().strip()
value_dict["text"] = el.get_text().strip()

url_rels = value_dict.get("rels", [])
value_dict["rels"] = url_rels
Expand All @@ -411,7 +411,7 @@ def parse_rels(el):
alternate_dict["url"] = url
x = " ".join(
[r for r in rel_attrs if not r == "alternate"])
if x is not "":
if x != "":
alternate_dict["rel"] = x
alternate_dict["text"] = text_type(el.get_text().strip())
for knownattr in ("media", "hreflang", "type", "title"):
Expand Down