diff --git a/neo/core/spiketrain.py b/neo/core/spiketrain.py
index 5d285ae0..7256511b 100644
--- a/neo/core/spiketrain.py
+++ b/neo/core/spiketrain.py
@@ -54,6 +54,9 @@ def _check_time_in_range(value, t_start, t_stop, view=False):
     certain that the dtype and units are the same
     '''
 
+    if t_start > t_stop:
+        raise ValueError("t_stop (%s) is before t_start (%s)" % (t_stop, t_start))
+
     if not value.size:
         return
 
@@ -217,8 +220,8 @@ class SpikeTrain(BaseNeo, pq.Quantity):
         constructor, but not when slicing.
         '''
         if len(times) != 0 and waveforms is not None and len(times) != \
-                waveforms.shape[
-                    0]:  # len(times)!=0 has been used to workaround a bug occuring during neo import)
+                waveforms.shape[0]:
+            # len(times)!=0 has been used to workaround a bug occuring during neo import
             raise ValueError(
                 "the number of waveforms should be equal to the number of spikes")
 

t_start > t_stop issue in SpikeTrain
I am transferring the issue from https://github.com/NeuralEnsemble/elephant/issues/81 here. Is following intended? 

```python
import neo
import quantities as pq 
print(neo.SpikeTrain([]*pq.s, t_start=5*pq.s, t_stop=4*pq.s))
>>> [] s
``` 

I am on version `0.5.2`.
Shouldn't start and stop times in `neo.SpikeTrain` checked and an error thrown? 
diff --git a/neo/test/coretest/test_spiketrain.py b/neo/test/coretest/test_spiketrain.py
index 22dd0bc8..ed5cec3b 100644
--- a/neo/test/coretest/test_spiketrain.py
+++ b/neo/test/coretest/test_spiketrain.py
@@ -142,6 +142,12 @@ class Testcheck_time_in_range(unittest.TestCase):
         _check_time_in_range(value, t_start=t_start, t_stop=t_stop, view=False)
         _check_time_in_range(value, t_start=t_start, t_stop=t_stop, view=True)
 
+    def test__check_time_in_range_empty_array_invalid_t_stop(self):
+        value = np.array([])
+        t_start = 6 * pq.s
+        t_stop = 4 * pq.s
+        self.assertRaises(ValueError, _check_time_in_range, value, t_start=t_start, t_stop=t_stop)
+
     def test__check_time_in_range_exact(self):
         value = np.array([0., 5., 10.]) * pq.s
         t_start = 0. * pq.s
@@ -1558,7 +1564,7 @@ class TestPropertiesMethods(unittest.TestCase):
     def test__repr(self):
         result = repr(self.train1)
         if np.__version__.split(".")[:2] > ['1', '13']:
-            # see https://github.com/numpy/numpy/blob/master/doc/release/1.14.0-notes.rst#many-changes-to-array-printing-disableable-with-the-new-legacy-printing-mode
+            # see https://github.com/numpy/numpy/blob/master/doc/release/1.14.0-notes.rst#many-changes-to-array-printing-disableable-with-the-new-legacy-printing-mode  # nopep8
             targ = '<SpikeTrain(array([3., 4., 5.]) * ms, [0.5 ms, 10.0 ms])>'
         else:
             targ = '<SpikeTrain(array([ 3.,  4.,  5.]) * ms, [0.5 ms, 10.0 ms])>'
diff --git a/neo/test/iotest/test_nestio.py b/neo/test/iotest/test_nestio.py
index 155e3974..1686644d 100644
--- a/neo/test/iotest/test_nestio.py
+++ b/neo/test/iotest/test_nestio.py
@@ -673,8 +673,8 @@ class TestNestIO_Spiketrains(BaseTestIO, unittest.TestCase):
             filename='0gid-1time-1256-0.gdf',
             directory=self.local_test_dir, clean=False)
         r = NestIO(filenames=filename)
-        seg = r.read_segment(gid_list=[], t_start=400. * pq.ms,
-                             t_stop=1. * pq.ms)
+        seg = r.read_segment(gid_list=[], t_start=400.4 * pq.ms,
+                             t_stop=400.5 * pq.ms)
         for st in seg.spiketrains:
             self.assertEqual(st.size, 0)
 
@@ -689,7 +689,7 @@ class TestNestIO_Spiketrains(BaseTestIO, unittest.TestCase):
             directory=self.local_test_dir, clean=False)
         r = NestIO(filenames=filename)
         st = r.read_spiketrain(gdf_id=0, t_start=400. * pq.ms,
-                               t_stop=1. * pq.ms)
+                               t_stop=410. * pq.ms)
         self.assertEqual(st.size, 0)
 
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
importlib-metadata==4.8.3
iniconfig==1.1.1
-e git+https://github.com/NeuralEnsemble/python-neo.git@643f889779ded1333bd433e004fe1f05b5c33026#egg=neo
nose==1.3.7
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
py==1.11.0
pyparsing==3.1.4
pytest==7.0.1
quantities==0.13.0
tomli==1.2.3
typing_extensions==4.1.1
zipp==3.6.0

name: python-neo
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - nose==1.3.7
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - py==1.11.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - quantities==0.13.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - zipp==3.6.0
prefix: /opt/conda/envs/python-neo

neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_empty_array_invalid_t_stop
neo/test/coretest/test_spiketrain.py::Test__generate_datasets::test__fake_neo__cascade neo/test/coretest/test_spiketrain.py::Test__generate_datasets::test__fake_neo__nocascade neo/test/coretest/test_spiketrain.py::Test__generate_datasets::test__get_fake_values neo/test/coretest/test_spiketrain.py::Testcheck_has_dimensions_time::test__check_has_dimensions_time neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_above neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_above_below neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_above_below_scale neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_above_scale neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_below neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_below_scale neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_empty_array neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_exact neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_inside neo/test/coretest/test_spiketrain.py::Testcheck_time_in_range::test__check_time_in_range_scale neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_empty neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_empty_no_t_start neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_no_start_stop_units neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_no_start_stop_units_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_no_start_stop_units_with_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_with_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_with_incompatible_units_ValueError neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_array_without_units_should_raise_ValueError neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_list neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_list_no_start_stop_units neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_list_no_start_stop_units_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_list_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_list_without_units_should_raise_ValueError neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_no_start_stop_units neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_no_start_stop_units_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_no_start_stop_units_with_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_units neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_units_no_start_stop_units neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_units_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_units_with_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_array_with_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_from_quantity_units_no_start_stop_units_set_dtype neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_minimal neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_with_len_times_different_size_than_waveform_shape1_ValueError neo/test/coretest/test_spiketrain.py::TestConstructor::test__create_with_times_outside_tstart_tstop_ValueError neo/test/coretest/test_spiketrain.py::TestConstructor::test_default_tstart neo/test/coretest/test_spiketrain.py::TestConstructor::test_defaults neo/test/coretest/test_spiketrain.py::TestConstructor::test_tstop_units_conversion neo/test/coretest/test_spiketrain.py::TestSorting::test_sort neo/test/coretest/test_spiketrain.py::TestSlice::test_compliant neo/test/coretest/test_spiketrain.py::TestSlice::test_slice neo/test/coretest/test_spiketrain.py::TestSlice::test_slice_from_beginning neo/test/coretest/test_spiketrain.py::TestSlice::test_slice_negative_idxs neo/test/coretest/test_spiketrain.py::TestSlice::test_slice_to_end neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_compliant neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_differnt_units neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_empty neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_matching_ends neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_none_both neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_none_start neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_none_stop neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_out_of_boundries neo/test/coretest/test_spiketrain.py::TestTimeSlice::test_time_slice_typical neo/test/coretest/test_spiketrain.py::TestMerge::test_compliant neo/test/coretest/test_spiketrain.py::TestMerge::test_correct_shape neo/test/coretest/test_spiketrain.py::TestMerge::test_correct_times neo/test/coretest/test_spiketrain.py::TestMerge::test_incompatible_t_start neo/test/coretest/test_spiketrain.py::TestMerge::test_merge_typical neo/test/coretest/test_spiketrain.py::TestMerge::test_merge_with_waveforms neo/test/coretest/test_spiketrain.py::TestMerge::test_missing_waveforms_error neo/test/coretest/test_spiketrain.py::TestMerge::test_neo_relations neo/test/coretest/test_spiketrain.py::TestMerge::test_rescaling_units neo/test/coretest/test_spiketrain.py::TestMerge::test_sampling_rate neo/test/coretest/test_spiketrain.py::TestDuplicateWithNewData::test_deep_copy_attributes neo/test/coretest/test_spiketrain.py::TestDuplicateWithNewData::test_duplicate_with_new_data neo/test/coretest/test_spiketrain.py::TestAttributesAnnotations::test_annotations neo/test/coretest/test_spiketrain.py::TestAttributesAnnotations::test_autoset_universally_recommended_attributes neo/test/coretest/test_spiketrain.py::TestAttributesAnnotations::test_set_universally_recommended_attributes neo/test/coretest/test_spiketrain.py::TestChanging::test__adding_time neo/test/coretest/test_spiketrain.py::TestChanging::test__changing_multiple_spiketimes neo/test/coretest/test_spiketrain.py::TestChanging::test__changing_multiple_spiketimes_should_check_time_in_range neo/test/coretest/test_spiketrain.py::TestChanging::test__changing_spiketime_should_check_time_in_range neo/test/coretest/test_spiketrain.py::TestChanging::test__rescale neo/test/coretest/test_spiketrain.py::TestChanging::test__rescale_incompatible_units_ValueError neo/test/coretest/test_spiketrain.py::TestChanging::test__rescale_same_units neo/test/coretest/test_spiketrain.py::TestChanging::test__subtracting_time neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_default neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_default_and_data_not_quantity neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_false neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_false_and_data_not_quantity neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_false_and_dtype_change neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_false_and_fake_rescale neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_false_and_rescale_true neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_true neo/test/coretest/test_spiketrain.py::TestChanging::test_change_with_copy_true_and_data_not_quantity neo/test/coretest/test_spiketrain.py::TestChanging::test_changing_slice_changes_original_spiketrain neo/test/coretest/test_spiketrain.py::TestChanging::test_changing_slice_changes_original_spiketrain_with_copy_false neo/test/coretest/test_spiketrain.py::TestChanging::test_init_with_rescale neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__children neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__compliant neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__duration neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__repr neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__right_sweep neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__sampling_period neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__spike_duration neo/test/coretest/test_spiketrain.py::TestPropertiesMethods::test__times neo/test/coretest/test_spiketrain.py::TestMiscellaneous::test__different_dtype_for_t_start_and_array neo/test/coretest/test_spiketrain.py::TestMiscellaneous::test_as_array neo/test/coretest/test_spiketrain.py::TestMiscellaneous::test_as_quantity neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_assert_readed_neo_object_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_id_column_none_multiple_neurons neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_load_lazy_objects neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_multiple_value_columns neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_no_gid neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_no_gid_no_time neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_notimeid neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_read_analogsignal neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_read_block neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_read_segment neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_read_then_write neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_readed_with_lazy_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_single_gid neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_t_start_t_stop neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_values neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_write_then_read neo/test/iotest/test_nestio.py::TestNestIO_Analogsignals::test_wrong_input neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_adding_custom_annotation neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_assert_readed_neo_object_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_gdf_id_illdefined_raises_error neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_load_lazy_objects neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_float neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_integer neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_segment neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_segment_accepts_range neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_segment_annotates neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_segment_can_return_empty_spiketrains neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_segment_range_is_reasonable neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_spiketrain neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_spiketrain_annotates neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_spiketrain_can_return_empty_spiketrain neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_read_then_write neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_readed_with_lazy_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_t_start_t_stop neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_t_start_undefined_raises_error neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_t_stop_undefined_raises_error neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_values neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_write_then_read neo/test/iotest/test_nestio.py::TestNestIO_Spiketrains::test_wrong_input neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_assert_readed_neo_object_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_load_lazy_objects neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_read_analogsignal_and_spiketrain neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_read_then_write neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_readed_with_lazy_is_compliant neo/test/iotest/test_nestio.py::TestNestIO_multiple_signal_types::test_write_then_read neo/test/iotest/test_nestio.py::TestColumnIO::test_assert_readed_neo_object_is_compliant neo/test/iotest/test_nestio.py::TestColumnIO::test_correct_condition_selection neo/test/iotest/test_nestio.py::TestColumnIO::test_load_lazy_objects neo/test/iotest/test_nestio.py::TestColumnIO::test_multiple_column_ids neo/test/iotest/test_nestio.py::TestColumnIO::test_no_arguments neo/test/iotest/test_nestio.py::TestColumnIO::test_no_condition neo/test/iotest/test_nestio.py::TestColumnIO::test_no_condition_column neo/test/iotest/test_nestio.py::TestColumnIO::test_read_then_write neo/test/iotest/test_nestio.py::TestColumnIO::test_readed_with_lazy_is_compliant neo/test/iotest/test_nestio.py::TestColumnIO::test_single_column_id neo/test/iotest/test_nestio.py::TestColumnIO::test_sorting neo/test/iotest/test_nestio.py::TestColumnIO::test_write_then_read
neo/core/spiketrain.py
neo/core/spiketrain.py