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.

Unit test failed

See original GitHub issue
_________________________________________ test_get_molnet_bbbp_dataset_with_smiles _________________________________________

    @pytest.mark.slow
    def test_get_molnet_bbbp_dataset_with_smiles():
        # test default behavior
        pp = AtomicNumberPreprocessor()
        datasets = molnet.get_molnet_dataset('bbbp', preprocessor=pp,
                                             return_smiles=True)
    
        assert 'smiles' in datasets.keys()
        assert 'dataset' in datasets.keys()
        smileses = datasets['smiles']
        datasets = datasets['dataset']
        assert len(smileses) == 3
        assert len(datasets) == 3
    
        # Test each train, valid and test dataset
        for i, dataset in enumerate(datasets):
            # --- Test dataset is correctly obtained ---
            index = np.random.choice(len(dataset), None)
            atoms, label = dataset[index]
    
            assert atoms.ndim == 1  # (atom, )
            assert atoms.dtype == np.int32
            # (atom from, atom to) or (edge_type, atom from, atom to) assert label.ndim == 1
            assert label.shape[0] == 1
            assert label.dtype == np.int32
>           assert len(dataset) == expect_bbbp_lengths[i]
E           assert 1630 == 1631
E            +  where 1630 = len(<chainer_chemistry.datasets.numpy_tuple_dataset.NumpyTupleDataset object at 0x2b5c61c03d30>)

datasets_tests/molnet_tests/test_molnet.py:81: AssertionError

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
delta2323commented, Jul 11, 2018

Good news. When we add the option here, too. The error disappears. https://github.com/pfnet-research/chainer-chemistry/blob/a54b464dc2ec90b6dfce7326bfd981024cd91d8b/chainer_chemistry/dataset/preprocessors/mol_preprocessor.py#L33

So, we can identify the cause was https://github.com/rdkit/rdkit/issues/1679 , which has been included in rdkit 2018.03.1

0reactions
mottodoracommented, Jul 19, 2018

This problem is solved by #237 When you encounter same problem, please re-open issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why are unit tests failing seen as bad?
A test failure may indicate a planned feature under TDD which isn't yet implemented; or it may indicate a known issue which has...
Read more >
How to write good unit tests: Write failing tests first
To write reliable unit tests, always start writing a failing test. And make sure it fails for the right reasons. Follow the Red,...
Read more >
How do you deal with failing unit tests? [closed] - Stack Overflow
Delete them if I don't understand the test, or if the test is out of date/out of synch with current specs; Refactor it...
Read more >
Are Your Unit Tests Failing and You Don't Know Why? - Parasoft
The reasons for the noise usually come down to a few basic problems: bad tests, fragile tests, or poor assertions. Bad tests are...
Read more >
unittest — Unit testing framework — Python 3.11.1 ...
Skipping tests and expected failures​​ New in version 3.1. Unittest supports skipping individual test methods and even whole classes of tests.
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