How do I run tests correctly?

Hi all!

I found a bug and want to write a test to go with my PR…but I am stuck on this error

When I run $ pytest I end with an error I cannot solve:

Failure: test_image_to_image_different_tfms

    def test_image_to_image_different_tfms():
        this_tests(get_transforms)
        get_y_func = lambda o:o
        mnist = untar_data(URLs.COCO_TINY)
        x_tfms = get_transforms()
        y_tfms = [[t for t in x_tfms[0]], [t for t in x_tfms[1]]]
        y_tfms[0].append(flip_lr())
        data = (ImageImageList.from_folder(mnist)
                .split_by_rand_pct()
                .label_from_func(get_y_func)
                .transform(x_tfms)
                .transform_y(y_tfms)
                .databunch(bs=16))

>       x,y = data.one_batch()

tests/test_vision_data.py:342:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
fastai/basic_data.py:168: in one_batch
    try:     x,y = next(iter(dl))
fastai/basic_data.py:75: in __iter__
    for b in self.dl: yield self.proc_batch(b)
../../../.local/share/virtualenvs/fastai-2waYueJb/lib/python3.7/site-packages/torch/utils/data/dataloader.py:193: in __iter__
    return _DataLoaderIter(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

signum = 20, frame = <frame at 0x138c52528, file '/Users/Kaweh/.local/share/virtualenvs/fastai-2waYueJb/lib/python3.7/site-packages/torch/utils/data/dataloader.py', line 193, code __iter__>

    def handler(signum, frame):
        # This following call uses `waitid` with WNOHANG from C side. Therefore,
        # Python can still get and update the process status successfully.
>       _error_if_any_worker_fails()
E       RuntimeError: DataLoader worker (pid 62874) is killed by signal: Unknown signal: 0.

../../../.local/share/virtualenvs/fastai-2waYueJb/lib/python3.7/site-packages/torch/utils/data/_utils/signal_handling.py:63: RuntimeError
---------------------------------------------------------------------------------------------------------------- Captured stderr call -----------------------------------------------------------------------------------------------------------------
ERROR: Unexpected segmentation fault encountered in worker.
ERROR: Unexpected segmentation fault encountered in worker.
ERROR: Unexpected segmentation fault encountered in worker.
ERROR: Unexpected segmentation fault encountered in worker.

It’s hard to say without knowing your environment. It seems to be a problem with PyTorch and multiprocessing, not fastai.