def METHOD_NAME():
    coord = ([9999], [9999])
    pixel_type = 'hot'
    dark = dark_monitor.Dark()
    dark.instrument = 'nircam'
    dark.detector = 'nrcalong'
    dark.identify_tables()
    # bad pixel type should raise error
    with pytest.raises(ValueError) as err:
        dark.exclude_existing_badpix(coord, 'test_bad_type')
    assert 'bad pixel type' in str(err)
    files = ['test.fits']
    obs_start = obs_mid = obs_end = datetime.datetime.now()
    baseline = 'test_baseline.fits'
    mean_file = 'test_meanfile.fits'
    try:
        # new pixel should not be found
        new_x, new_y = dark.exclude_existing_badpix(coord, pixel_type)
        assert new_x == [9999]
        assert new_y == [9999]
        # add pixel, test again
        dark.add_bad_pix(coord, pixel_type, files, mean_file,
                         baseline, obs_start, obs_mid, obs_end)
        new_entries = di.session.query(dark.pixel_table).filter(
            dark.pixel_table.baseline_file == baseline)
        assert new_entries.count() == 1
        # new pixel should be found
        new_x, new_y = dark.exclude_existing_badpix(coord, pixel_type)
        assert new_x == []
        assert new_y == []
    finally:
        # clean up
        di.session.query(dark.pixel_table).filter(
            dark.pixel_table.baseline_file == baseline).delete()
        di.session.commit()
        assert di.session.query(dark.pixel_table).filter(
            dark.pixel_table.baseline_file == baseline).count() == 0