question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

a couple of tests fail

See original GitHub issue

https://files.pythonhosted.org/packages/7c/43/734f8aad7f4d3f5ba02a52696dcead52a6d2d8b66f4fa98523e5b806a662/usaddress-scourgify-0.1.11.tar.gz

========================================================================================================== test session starts ==========================================================================================================
platform darwin -- Python 3.7.6, pytest-5.4.1, py-1.8.1, pluggy-0.13.1
rootdir: /path/to/scourgify/scourgify/usaddress-scourgify-0.1.11
collected 25 items                                                                                                                                                                                                                      

scourgify/tests/test_address_normalization.py ............F...........                                                                                                                                                            [ 96%]
scourgify/tests/test_cleaning.py F                                                                                                                                                                                                [100%]

=============================================================================================================== FAILURES ================================================================================================================
_____________________________________________________________________________________ TestAddressNormalizationUtils.test_handle_abnormal_occupancy ______________________________________________________________________________________

self = <scourgify.tests.test_address_normalization.TestAddressNormalizationUtils testMethod=test_handle_abnormal_occupancy>

    def test_handle_abnormal_occupancy(self):
        addr_str = '123 SW MAIN UN'
        expected = OrderedDict([
            ('AddressNumber', '123'),
            ('StreetNamePreDirectional', 'SW'),
            ('StreetName', 'MAIN'),
            ('StreetNamePostType', 'UN'),
        ])
        result = parse_address_string(addr_str)
        self.assertEqual(expected, result)
    
        addr_str = '123 SW MAIN UN A'
        expected = OrderedDict([
            ('AddressNumber', '123'),
            ('StreetNamePreDirectional', 'SW'),
            ('StreetName', 'MAIN'),
            ('OccupancyType', 'UN'),
            ('OccupancyIdentifier', 'A')
        ])
        result = parse_address_string(addr_str)
>       self.assertEqual(expected, result)
E       AssertionError: Order[91 chars]), ('OccupancyType', 'UN'), ('OccupancyIdentifier', 'A')]) != Order[91 chars]), ('StreetNamePostType', 'UN'), ('OccupancyIdentifier', 'A')])

scourgify/tests/test_address_normalization.py:650: AssertionError
________________________________________________________________________________________________ CleaningTests.test_strip_occupancy_type ________________________________________________________________________________________________

self = <scourgify.tests.test_cleaning.CleaningTests testMethod=test_strip_occupancy_type>

    def test_strip_occupancy_type(self):
        expected = '33'
    
        line2 = 'Unit 33'
        result = strip_occupancy_type(line2)
        self.assertEqual(result, expected)
    
        line2 = 'Apartment 33'
        result = strip_occupancy_type(line2)
        self.assertEqual(result, expected)
    
        line2 = 'Unit #33'
        result = strip_occupancy_type(line2)
        self.assertEqual(result, expected)
    
        line2 = 'Building 3 Unit 33'
        result = strip_occupancy_type(line2)
        self.assertEqual(result, expected)
    
        line2 = 'Building 3 UN 33'
        result = strip_occupancy_type(line2)
>       self.assertEqual(result, expected)
E       AssertionError: '3 UN 33' != '33'
E       - 3 UN 33
E       + 33

scourgify/tests/test_cleaning.py:38: AssertionError
--------------------------------------------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------------------------------------------
['3', 'UN', '33']

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
fabletcommented, May 8, 2020

Excellent! I’m glad we were able to work through it!

0reactions
zyxuecommented, May 8, 2020

Thank you! I’m not too familiar with tox, but I see why now, and I can make it work with

ADDRESS_CONFIG_DIR=${PWD}/scourgify/tests/config pytest scourgify/tests
Read more comments on GitHub >

github_iconTop Results From Across the Web

The Test-Fail Dynamic In Couples And What To Do About It
The test-fail pattern consists of one partner presenting the other with an objective that they cannot seem to achieve. They may be limited...
Read more >
What To Do When Tests Fail? - TestProject
What Should I Do When a Test Fails? ... Tests usually fail due to server and network issues, an unresponsive application or validation...
Read more >
Tests that sometimes fail | Hacker News
We've had a couple of cases of flaky tests failing builds over the last two years at my company. Most often it's browser...
Read more >
A couple meme tests fail #10 - GitHub
ERROR : /meme-5.0.5/tests/scripts/dreme.test (FAULT IN TEST!) FAIL: meme-chip1 (CRASH!) There's a solution suggested here: Nevermind, I got it.
Read more >
How to Fix Flaky Tests - Semaphore CI
Randomly failing tests are the hardest to debug. Here's a framework you can use to fix them and keep your test suite healthy....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found